//
//  DSOSliderPlot.h
//  Balance
//
//  Created by oracle on 7/23/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CorePlot-CocoaTouch.h"
#import "DSOData.h"


@protocol DSOSliderPlotDelegate;


@interface DSOSliderPlot : NSObject<CPTPlotDataSource,CPTPlotSpaceDelegate, CPTScatterPlotDataSource>

{
@private
    CPTGraph *graph;
    CPTScatterPlot *sliderPlot;
    CPTScatterPlot *fromIndicatorPlot; //date range selector: from-date
    CPTScatterPlot *toIndicatorPlot;  //date range selector: to-date
    CPTRangePlot *rangePlot;
    NSMutableDictionary *dailyDSO;
    NSArray *dailyKeys;
    NSUInteger totalNoOfDataPoints;
    NSArray * monthlyKeys;
    NSString *direction;
    NSInteger previousXPoint;
    NSInteger fromIndex;
    NSInteger toIndex;
    NSInteger previousFromIndex;
    NSInteger previousToIndex;
    NSInteger selectedCoordination;
    NSInteger numberOfPeriods;
    BOOL fromIndicatorPlotSelected, toIndicatorPlotSelected;
    BOOL rangePlotMoved;
    NSDate *startDate;
    DSOData *startDateData;
    DSOData *endDateData;
}

@property (nonatomic, retain) id<DSOSliderPlotDelegate> delegate;

- (id) initWithOneCustomerData:(NSMutableDictionary *) dsoData monthlyData:(NSArray *)monthlyData;
- (void)renderInLayer:(CPTGraphHostingView *)layerHostingView withTheme:(CPTTheme *)theme;
- (void)applyIndicatorPlotColor;    
- (void)highlightPlotColor:(CPTScatterPlot *)plot;


@end

// Delegate to notify the view controller that the location of the line has changed.
@protocol DSOSliderPlotDelegate <NSObject> 
@optional

- (void)sliderPlot:(DSOSliderPlot *)plot fromDate:(NSString *)fromDateString toDate:(NSString *)toDateString;




@end
